#include "log.hpp"
#include "sharemem.hpp"

int main()
{
    int shmid = getshare();
    if(shmid<0){exit(2);}

    int fd = open("myfifo",O_WRONLY|O_APPEND|O_CREAT, 0666);
    char* sc = (char*)shmat(shmid, nullptr, 0);//记得强转

    while(true)
    {
        cout << "Enter@: ";
        //strlen+1：读取方希望获得完整的字符串
        fgets(sc,size,stdin);
        write(fd,"1",1);
    }
    return 0;
}